#ifndef RUNNINGCHARTBAR_H
#define RUNNINGCHARTBAR_H

#include <QObject>
#include <QVariant>
#include <QVariantList>
#include <QVariantMap>
#include <QRandomGenerator>
#include <QQuickItem>
#include <QTime>
#include <QWidget>
#include <QLabel>
#include <QHBoxLayout>
#include <QQuickWidget>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QMainWindow>
#include <QBarSet>
#include <QChart>
#include <QBarSeries>
#include <QChart>
#include <QDebug>
#include <QChartView>
#include <QScrollArea>
#include <QBarCategoryAxis>
#include <QValueAxis>
#include "widgetanchor.h"
#include "experimentPro.h"
#include "mockInterface.h"

using namespace QtCharts;
class RunningChartBar : public QObject
{
    Q_OBJECT
public:
    RunningChartBar();

    Q_INVOKABLE void load(); // 第一次加载初始化，后续不用再加载了
    Q_INVOKABLE void show();
    Q_INVOKABLE void refresh(QString equId, QString accessInfo, QString posInfo);
    Q_INVOKABLE void hide();

public slots:
    void onAnchorRectChanged(int, int, int, int);

public:
    QQmlApplicationEngine*  engine = nullptr;
    ExperimentPro*          expPro = nullptr;
    MockInterface*          mock = nullptr;

    QChart*                 _chart = nullptr;
    QChartView*             _chartview = nullptr;
    QScrollArea*            _scrollArea;
    QBarSeries*             _series;

    QBarSet*                set_FAM = nullptr;
    QBarSet*                set_ROX = nullptr;
    QBarSet*                set_CY5 = nullptr;
    QBarSet*                set_VIC = nullptr;

    QBarCategoryAxis *      _axis;
    QValueAxis*             _axis_y;
    WidgetAnchor*           _anchor;


};

#endif // RUNNINGCHARTBAR_H
